-
Notifications
You must be signed in to change notification settings - Fork 402
RFC for branch management #1370
base: master
Are you sure you want to change the base?
Conversation
Everything proposed would be a great improvement to the current branch tooltip. 👍
A concern @kuychaco mentioned: If we would do first this RFC, and then later move branch management to a panel #556, some people might prefer to keep using the command palette and get 😖. Something I like about the command palette UI: Once you're done, the dialog closes automatically and the rest of the UI is still the same. With a panel/dock item, you have to manually switch back to, for example, the tree-view. Seeing the list of branches isn't that beneficial while you code. On the other hand, having a panel/dock item gives us the freedom to add any custom UI we want. So maybe the question is: When does the command palette UI reach its limits? And does that happen anytime soon-ish?
Maybe a branch with merged commits can be deleted without confirmation? Since nothing is lost. And also have an icon or different color, so it's easy to see which branches aren't really needed anymore. Some more open questions: 1. Sorting of the branch listShould the list of local branches be sorted in a special way (other than alphabetically)?
2. "All in one" UIAnother thing I wonder, should there be an additional checkout-branch
create-new-branch
delete-branch
rename-branch
Some benefits:
Concerns: Harder to discover. So it probably would need some extra hints, maybe at the bottom of the list. Like
Each list item could also have a context menu with [Delete] and [Rename] as an extra option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more that I think about this the more that I prefer it to what we've got in #556. 👍
I was initially hesitant because I prefer to avoid modal interactions when I can in favor of more continuous representations of state. But I really like how this will scale to a large number of branches and the consistency with other Atom UI.
This does not give us an obvious way to add merge or rebase later... but now I think those belong in the log view, anyway, where you have more context.
|
||
## Motivation | ||
|
||
Current branch management is incomplete (e.g. no deleting of branches) and not consistent with other conventions found in the Atom UI for comparable actions. It is hard to switch or create new branches with just keyboard input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about keyboard input here.
- Create new branch (`github:create-new-branch`) | ||
- Checkout branch (`github:checkout-branch`) | ||
- Delete branch (`github:delete-branch`) | ||
- Rename branch (`github:rename-branch`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second @simurai's suggestion about collapsing these into a single command, or at least checkout and create. That'd be consistent with the way that github.com does it:
I think it'd be nice to not have to lose your search and place in the list to do a bunch of branch-related tasks at once.
|
||
#### `github:checkout-branch` | ||
|
||
Executing `github:checkout-branch` opens a filterable command palette list of local branches, similar to the list of available grammars when executing `grammar-selector:show`. Selecting a branch from that list switches to that branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you feel about including remote tracking branches in the filter list? We could style or decorate them slightly differently as a visual cue, and then create a new local branch that tracks them like git checkout -b
does. Might be a nice way to fill in some missing functionality from the existing branch selector.
|
||
#### `github:delete-branch` | ||
|
||
Executing `github:delete-branch` opens a filterable command palette list of local branches, the same as executing `github:checkout-branch`. Selecting a branch from that list will show a prompt asking for confirmation to delete _[named branch_], including information whether that branch's merge status (e.g. _'test3' has been merged to 'refs/remotes/origin/test3', but not yet merged to HEAD._). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like having the extra merge status in the list here. It's a nice way to give you a little more context about the action you're about to take.
I'm not sure what this looks like in a world where the branch commands are unified. Any ideas, @simurai? Maybe we always show the merge status if there is one... ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a different icon?
The merged branch icon is used for merged pull requests, but maybe ok in this context.
Maybe even less contrast to signal: "This branch can probably be deleted".
Thanks for the feedback so far, folks, that's great input. I like the idea of having only one branch list and then ways to execute all possible actions based on that. I would also consider showing remote branches in that list, but probably below all local branches. I think combining that with @simurai's suggestion of sorting branches by |
💯 That would be awesome. I'll make some mockups to explore how it could look. Maybe have some divider between local + remote. |
Here some mockups: Remote default branchA repo's default branch always shows up at the top (minus when filtering). Note that this is the default branch on the remote ( In the above example, you can switch to the local master branch if you need to, but that's mostly to go back in history and test a certain commit. Otherwise always having an up-to-date master is probably preferred. Local vs remoteThe list has "gaps" to divide local and remote branches. In addition, remote branches show the remote name (e.g. Branches are sorted by most recent changes and shown in these groups:
Open question: Should local branches show the remote tracking branch? Maybe when you select a local branch it could show it like: Or something a bit more subtle like showing a tooltip on hover. In the future we might can let users switch the remote tracking branch as well. Current branchThe current branch has a border on the left. FilteringTo filter the list, you can start typing. Create a branchIf you type long enough, the "Create branch" option will probably be the only one left and thus selected. Pressing now enter creates the new branch. This behavior might be a bit harder to to discover than having a dedicated "Create branch" button. We can add a hint at the bottom. Also, .com already uses it, so it wouldn't be completely new. Open question: Should there be an option to directly create a new branch from Sometimes having to do an extra step might be ok because you don't have to read a dialog every time and make a choice. Exact matchIf you type a name that matches a local branch, the "Create branch" won't be shown. RenameWhen selecting a branch and pressing f2, the branch can be renamed: If the name already exists, the message changes to: DeleteWhen selecting a branch and pressing delete, the branch gets deleted and removed from the list. In case the branch contains un-merged commits, a confirmation dialog will be shown: Open question: Should the confirmation dialog have a "don't show this dialog again" option? Also, about showing the merge status of a branch. Feedback from a recent design review was that having a different icon and greyed out branch name isn't very obvious what it means. Even when adding a label/badge saying I'll post some more ideas in the next comment. |
The branches overview on .com shows some additional information, like if a branch has an associated PR and that PR's state. Here a possible mockup: It adds:
The above additions could be added as "nice to have" with less priority. |
Oh wow, really love the direction this is heading towards, @simurai + @mattmattmatt! 😍Had a couple of thoughts 💭:
I would find it helpful to understand which remote branch is a local branch tracking. A tooltip or something would make more sense here, given that there isn't a lot of space with both the local and remote branch name. |
Space is a bit unpredictable. The One themes have a width of
I was wondering about that too. Also because .com shows who is the last committer of a branch. Like Or maybe |
Formal proposal of improvements to branch management.
🎨 Pretty markdown version.
Related discussion and design ideating are available in #556.
Implementation phases
branch-menu-view
into command palette.branch-menu-view
with command palette, removingbranch-menu-view
.@annthurium @kuychaco @simurai @smashwilson